#ifndef ARCH_ASMDECL_H_
#define ARCH_ASMDECL_H_

/*
	Copyright (C) 2014 Salil Bhagurkar

	This file is part of illusion

	illusion is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	illusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

//
// File Visibility: ARCH
// Subsystem: ARCH
// File Description: This includes extern declarations for everything defined
// in assembly for the architecture.
//

#include <kernel/types.h>

extern void _bochs_break();
extern void _debug_break();
//We mark this as returning an unsigned long, since we don't save eax inside the asm procedure
extern u32 _gdt_flush(u32 gdt_ptr);
extern u32 _idt_flush(u32 idt_ptr);
extern void _tss_flush();
extern void _wp_enable();
extern u32 _read_cr0();
extern u32 _read_cr2();
extern u32 _read_cr3();
extern void _start_new_user_process(void *stack, void *user_entry,
		void *pg_dir);
extern void _start_new_kernel_process(void *stack, void *entry,
		void *pg_dir);
extern void _switch_to_new_user_process(void **save_stack,
		void *stack, void (*main)(),
		void *pg_dir);
extern void _switch_to_new_kernel_process(void **save_stack,
		void *stack, void (*main)(),
		void *pg_dir);
extern void _switch_to_process(void **save_stack, void *stack, void *cr3);
extern void _switch_to_process_no_save(void *stack, void *cr3);
extern void _process_exit_shift(void *stack, void *cr3, u32 code);
#define __JMPBUF_LEN	9	/* Sized to match freebsd setjmp buffer */
typedef int jmp_buf[__JMPBUF_LEN];
extern int _setjmp(jmp_buf env);
extern void _longjmp(jmp_buf env, int val);

extern u32 _kernel_end;
extern u32 _kernel_data;
extern u32 _kernel_start;
extern u32 _kernel_bss;
extern u32 _kernel_entry;
extern u32 _grub_multiboot_info;

extern void _isr0();
extern void _isr1();
extern void _isr2();
extern void _isr3();
extern void _isr4();
extern void _isr5();
extern void _isr6();
extern void _isr7();
extern void _isr8();
extern void _isr9();
extern void _isr10();
extern void _isr11();
extern void _isr12();
extern void _isr13();
extern void _isr14();
extern void _isr15();
extern void _isr16();
extern void _isr17();
extern void _isr18();
extern void _isr19();
extern void _isr20();
extern void _isr21();
extern void _isr22();
extern void _isr23();
extern void _isr24();
extern void _isr25();
extern void _isr26();
extern void _isr27();
extern void _isr28();
extern void _isr29();
extern void _isr30();
extern void _isr31();
extern void _isr32();
extern void _isr33();
extern void _isr34();
extern void _isr35();
extern void _isr36();
extern void _isr37();
extern void _isr38();
extern void _isr39();
extern void _isr40();
extern void _isr41();
extern void _isr42();
extern void _isr43();
extern void _isr44();
extern void _isr45();
extern void _isr46();
extern void _isr47();
extern void _isr48();
extern void _isr49();
extern void _isr50();
extern void _isr51();
extern void _isr52();
extern void _isr53();
extern void _isr54();
extern void _isr55();
extern void _isr56();
extern void _isr57();
extern void _isr58();
extern void _isr59();
extern void _isr60();
extern void _isr61();
extern void _isr62();
extern void _isr63();
extern void _isr64();
extern void _isr65();
extern void _isr66();
extern void _isr67();
extern void _isr68();
extern void _isr69();
extern void _isr70();
extern void _isr71();
extern void _isr72();
extern void _isr73();
extern void _isr74();
extern void _isr75();
extern void _isr76();
extern void _isr77();
extern void _isr78();
extern void _isr79();
extern void _isr80();
extern void _isr81();
extern void _isr82();
extern void _isr83();
extern void _isr84();
extern void _isr85();
extern void _isr86();
extern void _isr87();
extern void _isr88();
extern void _isr89();
extern void _isr90();
extern void _isr91();
extern void _isr92();
extern void _isr93();
extern void _isr94();
extern void _isr95();
extern void _isr96();
extern void _isr97();
extern void _isr98();
extern void _isr99();
extern void _isr100();
extern void _isr101();
extern void _isr102();
extern void _isr103();
extern void _isr104();
extern void _isr105();
extern void _isr106();
extern void _isr107();
extern void _isr108();
extern void _isr109();
extern void _isr110();
extern void _isr111();
extern void _isr112();
extern void _isr113();
extern void _isr114();
extern void _isr115();
extern void _isr116();
extern void _isr117();
extern void _isr118();
extern void _isr119();
extern void _isr120();
extern void _isr121();
extern void _isr122();
extern void _isr123();
extern void _isr124();
extern void _isr125();
extern void _isr126();
extern void _isr127();
extern void _isr128();
extern void _isr129();
extern void _isr130();
extern void _isr131();
extern void _isr132();
extern void _isr133();
extern void _isr134();
extern void _isr135();
extern void _isr136();
extern void _isr137();
extern void _isr138();
extern void _isr139();
extern void _isr140();
extern void _isr141();
extern void _isr142();
extern void _isr143();
extern void _isr144();
extern void _isr145();
extern void _isr146();
extern void _isr147();
extern void _isr148();
extern void _isr149();
extern void _isr150();
extern void _isr151();
extern void _isr152();
extern void _isr153();
extern void _isr154();
extern void _isr155();
extern void _isr156();
extern void _isr157();
extern void _isr158();
extern void _isr159();
extern void _isr160();
extern void _isr161();
extern void _isr162();
extern void _isr163();
extern void _isr164();
extern void _isr165();
extern void _isr166();
extern void _isr167();
extern void _isr168();
extern void _isr169();
extern void _isr170();
extern void _isr171();
extern void _isr172();
extern void _isr173();
extern void _isr174();
extern void _isr175();
extern void _isr176();
extern void _isr177();
extern void _isr178();
extern void _isr179();
extern void _isr180();
extern void _isr181();
extern void _isr182();
extern void _isr183();
extern void _isr184();
extern void _isr185();
extern void _isr186();
extern void _isr187();
extern void _isr188();
extern void _isr189();
extern void _isr190();
extern void _isr191();
extern void _isr192();
extern void _isr193();
extern void _isr194();
extern void _isr195();
extern void _isr196();
extern void _isr197();
extern void _isr198();
extern void _isr199();
extern void _isr200();
extern void _isr201();
extern void _isr202();
extern void _isr203();
extern void _isr204();
extern void _isr205();
extern void _isr206();
extern void _isr207();
extern void _isr208();
extern void _isr209();
extern void _isr210();
extern void _isr211();
extern void _isr212();
extern void _isr213();
extern void _isr214();
extern void _isr215();
extern void _isr216();
extern void _isr217();
extern void _isr218();
extern void _isr219();
extern void _isr220();
extern void _isr221();
extern void _isr222();
extern void _isr223();
extern void _isr224();
extern void _isr225();
extern void _isr226();
extern void _isr227();
extern void _isr228();
extern void _isr229();
extern void _isr230();
extern void _isr231();
extern void _isr232();
extern void _isr233();
extern void _isr234();
extern void _isr235();
extern void _isr236();
extern void _isr237();
extern void _isr238();
extern void _isr239();
extern void _isr240();
extern void _isr241();
extern void _isr242();
extern void _isr243();
extern void _isr244();
extern void _isr245();
extern void _isr246();
extern void _isr247();
extern void _isr248();
extern void _isr249();
extern void _isr250();
extern void _isr251();
extern void _isr252();
extern void _isr253();
extern void _isr254();
extern void _isr255();

extern void _irq0();
extern void _irq1();
extern void _irq2();
extern void _irq3();
extern void _irq4();
extern void _irq5();
extern void _irq6();
extern void _irq7();
extern void _irq8();
extern void _irq9();
extern void _irq10();
extern void _irq11();
extern void _irq12();
extern void _irq13();
extern void _irq14();
extern void _irq15();




#endif /* ARCH_ASMDECL_H_ */
